package com.ymatou.iapi.godmch.testcase;

import java.text.SimpleDateFormat;
import java.util.List;

import org.json.JSONException;
import org.json.JSONObject;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.godmch.parameter.applySupplierBean;
import com.ymatou.iapi.godmch.parameter.auditSupplierLogBean;
import com.ymatou.iapi.godmch.parameter.createIndepMchBean;
import com.ymatou.iapi.godmch.service.applyAgentCall;
import com.ymatou.iapi.godmch.service.applySupplierCall;
import com.ymatou.iapi.godmch.service.auditSupplierLogCall;
import com.ymatou.iapi.godmch.service.createIndepMchCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.model.godmch.supplierLog;
import com.ymttest.database.model.godmch.supplierLogExample;
import com.ymttest.database.sqlwapper.godmch.supplierLogWapper;
/**
*供货商审核日志列表
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_auditSupplierLog{
	private static auditSupplierLogBean bean;
	private static auditSupplierLogCall call;
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	supplierLogExample supplierLogExample=new supplierLogExample();
	supplierLogWapper supplierLogWapper=new supplierLogWapper();
	
	
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("供货商审核日志列表");
	}

	@Before
	public void caseUp() {
		bean=new auditSupplierLogBean();
		call=new auditSupplierLogCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	private void check_verify() throws InterruptedException, JSONException
	{
	    Integer currPage=bean.getPageIndex();
        Integer pageSize=bean.getPageSize();
		//验证
		Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
		Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
		
		supplierLogExample.createCriteria().andMchIdEqualTo(bean.getMchId()).andSupplierIdEqualTo(bean.getSupplierId());
		supplierLogExample.setOrderByClause("  createTime desc ");
		List<supplierLog> supplierLogs=  supplierLogWapper.selectByExample(supplierLogExample);    
		Logger.verifyEquals(call.getTotal(), supplierLogs.size(), "验证返回日志的总数");
		
		//从第几条数据开始
        int firstIndex = (currPage - 1) * pageSize;
        //到第几条数据结束
        int lastIndex = currPage * pageSize>supplierLogs.size()?supplierLogs.size():currPage * pageSize;
        
        supplierLogs=supplierLogs.subList(firstIndex, lastIndex);
   		
		for(int i=0;i<supplierLogs.size();i++)
		{
			supplierLog act_log=supplierLogs.get(i);
			JSONObject exp_obj=call.getList().getJSONObject(i);
			Logger.comment("验证logId:"+act_log.getLogId());
			Logger.verifyEquals(exp_obj.getString("operatorTime"), sdf.format(act_log.getCreateTime()), "验证第"+i+"条返回的operatorTime与数据库operatorTime一致");
			Logger.verifyEquals(exp_obj.getInt("logType"), act_log.getLogType(),  "验证第"+i+"条返回的logType与数据库logType一致");
			Logger.verifyEquals(exp_obj.getString("remark"), act_log.getRemark(),  "验证第"+i+"条返回的remark与数据库remark一致");
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_001() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是无代理独立商户-成功");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
        	call.callService();			
		
        	check_verify();
        	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_002() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-1:供货商申请-成功");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();			
			check_verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_002_1() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-拒绝重新申请-1:重新供货商申请-成功");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //拒绝
            GodmchManageCallService.rejectSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //重新申请
            GodmchManageCallService.ReApplySupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();			
			check_verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_002_2() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-删除重新申请-1:重新供货商申请-成功");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //审核通过
            GodmchManageCallService.approveSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //拒绝
            GodmchManageCallService.deleteSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //重新申请
            GodmchManageCallService.ReApplySupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();	
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_003() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-2:审核通过-成功");
		try {

			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //审核通过
            GodmchManageCallService.approveSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();	
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_003_1() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-重新申请通过-2:审核通过-成功");
		try {

			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //拒绝
            GodmchManageCallService.deleteSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //重新申请
            GodmchManageCallService.ReApplySupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //审核通过
            GodmchManageCallService.approveSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();		
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_004() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-3:审核拒绝-成功");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //审核拒绝
            GodmchManageCallService.rejectSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();			

			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_004_1() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-重新申请被拒绝-3:审核拒绝-成功");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //审核拒绝
            GodmchManageCallService.rejectSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            //重新申请代理商
            GodmchManageCallService.ReApplySupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            //审核拒绝
            GodmchManageCallService.rejectSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();			

			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_005() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-4:移除供货关系-成功");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //审核通过
            GodmchManageCallService.approveSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            //删除
            GodmchManageCallService.deleteSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();			

			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_005_1() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是有代理独立商户-重新申请通过后被移除关系4:移除供货关系-成功");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //拒绝
            GodmchManageCallService.rejectSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            //重新申请
            GodmchManageCallService.ReApplySupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            //审核通过
            GodmchManageCallService.approveSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            //删除
            GodmchManageCallService.deleteSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();			

			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_006() {
		Logger.start(true,"正例-供货商审核日志列表-独立商户Id是独立商户的代理-返回空");
		try {
			//独立商户
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //代理
            applyAgentCall applyAgentCall=GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //审核通过
            GodmchManageCallService.approveSupplier(applySupplierBean.getMchId(), applySupplierCall.getSupplierId());

            bean.setMchId(applyAgentCall.getAgentId());//独立商户的代理
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();			

			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_007() {
		Logger.start(true,"正例-供货商审核日志列表-显示中间页-第二页pageIndex=2,pageSize=1-成功");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //拒绝
            GodmchManageCallService.rejectSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //重新申请供货商
            GodmchManageCallService.ReApplySupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //重新申请供货商被拒绝
            GodmchManageCallService.rejectSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(2);
            bean.setPageSize(1);
            
			call.setData(bean);
        	call.callService();				
			
        	check_verify();
        	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_008() {
		Logger.start(true,"正例-供货商审核日志列表-显示最后一页pageIndex=max,pageSize=5-成功");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //拒绝
            GodmchManageCallService.rejectSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //重新申请供货商
            GodmchManageCallService.ReApplySupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            //重新申请供货商被拒绝
            GodmchManageCallService.rejectSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(2);
            bean.setPageSize(3);
			call.setData(bean);
			call.callService();			
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_009() {
		Logger.start(true,"正例-供货商审核日志列表-大于当前最大页pageIndex=max+1,pageSize=5-返回空");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(99);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();	
			
			Logger.verifyEquals(call.getTotal(), 1, "验证返回日志的总数");
			Logger.verifyEquals(call.getList().length(),0, "验证返回集合为空");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_010() {
		Logger.start(true,"正例-供货商审核日志列表-当前页大于最大条数-pageIndex=999999999-返回空");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(999999999);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();		
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(call.getTotal(), 1, "验证返回日志的总数");
			Logger.verifyEquals(call.getList().length(), 0, "验证返回集合为空");
			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_011() {
		Logger.start(true,"正例-供货商审核日志列表-每页条数大于最大条数-pageIndex=1,pageSize=999999999-成功");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(999999999);
            
			call.setData(bean);
			call.callService();	
	
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_012() {
		Logger.start(true,"正例-供货商审核日志列表-pageIndex=0-返回空");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(0);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("4001", call.getStatusCode1(), "验证status");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_013() {
		Logger.start(true,"正例-供货商审核日志列表-pageSize=0-返回空");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(0);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("4001", call.getStatusCode1(), "验证status");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_014() {
		Logger.start(true,"正例-供货商审核日志列表-mchId不存在-返回空");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId()+999);
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(call.getTotal(), 0, "验证返回日志的总数");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_015() {
		Logger.start(true,"正例-供货商审核日志列表-supplierId不存在-返回空");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId()+99);//不存在
            bean.setPageIndex(1);
            bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(true, call.getMessage().contains("请求成功"), "验证Message");
			Logger.verifyEquals(call.getTotal(), 0, "验证返回日志的总数");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_016() {
		Logger.start(true,"正例-供货商审核日志列表-mchId为空-失败");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
           // bean.setMchId(applySupplierBean.getMchId());
            bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("4001", call.getStatusCode1(), "验证status");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_auditSupplierLog_017() {
		Logger.start(true,"正例-供货商审核日志列表-supplierId为空-返回空");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            
            bean.setMchId(applySupplierBean.getMchId());
           // bean.setSupplierId(applySupplierCall.getSupplierId());
            bean.setPageIndex(1);
            bean.setPageSize(5);
            
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("4001", call.getStatusCode1(), "验证status");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}